home *** CD-ROM | disk | FTP | other *** search
- <%@ Language=VBScript CODEPAGE=65001 %>
- <!--#include file="include/wmsConstants.inc"-->
- <!--#include file="include/wmsLocStrings.inc"-->
- <!--#include file="include/wmsCommon.inc"-->
- <!--#include file="include/wmsHeader.inc"-->
- <!--#include file="include/wmsRefresh.inc"-->
- <!--#include file="include/wmsServerHash.inc"-->
- <!--#include file="include/wmsconnect.inc"-->
- <!--#include file="include/wmsError.inc"-->
- <!--#include file="include/wmsToolbar.inc"-->
- <!--#include file="include/wmsHelp.inc"-->
- <!--#include file="include/wmsPageBanner.inc"-->
- <!--#include file="include/wmsTabs.inc"-->
- <%
- '+-------------------------------------------------------------------------
- '
- ' Microsoft Windows Media
- ' Copyright (C) Microsoft Corporation. All rights reserved.
- '
- ' File: PubPoint_Ads.asp
- '
- ' Contents:
- '
- '--------------------------------------------------------------------------
-
- BeginErrorHandling
- ConnectToServer
- ConnectToPubPoint
-
- Dim bWrapperPathEnabled
- Dim strCurrentWrapperPath
- Dim dwTotAds
- Dim strTrimmedOp
- Dim bError
- Dim bReloadedForPathError
- Dim strNewPath
-
- if( empty = g_objPubPoint ) then
- Server.Transfer( "pubpoint_collection.asp" )
- end if
-
- dwTotAds = g_objPubPoint.TotalCounters.Advertisements
-
- bWrapperPathEnabled = g_objPubPoint.EnableWrapperPath
- strCurrentWrapperPath = g_objPubPoint.WrapperPath
-
- bError = FALSE
- bReloadedForPathError = FALSE
- strNewPath = ""
-
- '////////////////////////////////////////////////////////////////
- Function GetFormStr( szKey )
- GetFormStr = trim( CStr( posting( szKey ) ) )
- End Function
-
-
- '////////////////////////////////////////////////////////////////
- Function GetPostOrQsVal( szKey )
- Dim szVal
- szVal = GetFormStr( szKey )
-
- if( 0 = Len( szVal ) ) then
- szVal = CStr( qs( szKey ) )
- end if
-
- GetPostOrQsVal = szVal
- End Function
-
-
- '////////////////////////////////////////////////////////////////
- Function UnescapeFilePathSlashes( szUrl )
- UnescapeFilePathSlashes = Replace( szUrl, "\", "\\" )
- End Function
-
- '////////////////////////////////////////////////////////////////
- strTrimmedOp = RemoveDangerousCharacters( GetPostOrQsVal( "op" ) )
-
- if( 0 = strcomp( strTrimmedOp, "ChangeWrapper", vbTextCompare ) ) then
- on error resume next
- strNewPath = CStr( trim( GetPostOrQsVal("path") ) )
-
- if( 0 < Len( strNewPath ) ) then
- strNewPath = SafeUnescape( strNewPath )
- end if
-
- g_objPubPoint.WrapperPath = strNewPath
- strCurrentWrapperPath = g_objPubPoint.WrapperPath
-
- if( 0 = Len( strCurrentWrapperPath ) ) and ( bWrapperPathEnabled ) then
- g_objPubPoint.EnableWrapperPath = FALSE
- bWrapperPathEnabled = FALSE
- end if
- if ErrorDetected( "WrapperPath" ) then
- bError = TRUE
- end if
-
- elseif( 0 = strcomp( strTrimmedOp, "togglepath", vbTextCompare ) ) then
- on error resume next
- if( "on" = qs( "enableWrapper" ) ) then
- g_objPubPoint.EnableWrapperPath = TRUE
- bWrapperPathEnabled = TRUE
- else
- g_objPubPoint.EnableWrapperPath = FALSE
- bWrapperPathEnabled = FALSE
- end if
- if ErrorDetected( "EnableWrapper" ) then
- bError = TRUE
- end if
-
- elseif( 0 = strcomp( strTrimmedOp, "resetpeak", vbTextCompare ) ) then
- g_objPubPoint.TotalCounters.Reset()
- Response.Redirect( "pubpoint_ads.asp?server=" & g_strQueryStringServer & "&ppID=" & g_strPubPointID )
- Response.Flush
-
- elseif( 0 < Len( qs( "invalidPath" ) ) ) then
- strNewPath = SafeUnescape( qs( "invalidPath" ) )
- bReloadedForPathError = TRUE
- end if
-
- WriteHTMLHeader( g_strDecodedServerName )
- WriteRefreshMetaTag
- %>
- <link rel="stylesheet" type="text/css" href="<%= Session( "cssName" ) %>">
- <script language="JavaScript" src="include/WMSCommon.js"></script>
- <script language="JavaScript">
- <!--
- /*@cc_on @*/
- <% WriteCommonJSUtils %>
- ///////////////////////////////////////////////////////////////////////
- function Reset()
- {
- <% jsTRY %>
- document.location.replace( "<%= "pubpoint_ads.asp?server=" & g_strQueryStringServer & "&ppID=" & g_strPubPointID & "&op=ResetPeak"%>" );
- <% jsCATCH %>
- }
-
- ///////////////////////////////////////////////////////////////////////
- function EnableWrapper()
- {
- <% jsTRY %>
- document.location.replace( "<%= "pubpoint_ads.asp?server=" & g_strQueryStringServer & "&ppID=" & g_strPubPointID %>&op=togglepath&enableWrapper=on" );
- <% jsCATCH %>
- }
-
- ///////////////////////////////////////////////////////////////////////
- function DisableWrapper()
- {
- <% jsTRY %>
- document.location.replace( "<%= "pubpoint_ads.asp?server=" & g_strQueryStringServer & "&ppID=" & g_strPubPointID %>&op=togglepath&enableWrapper=off" );
- <% jsCATCH %>
- }
-
- ///////////////////////////////////////////////////////////////////////
- function EnableWrapperPath()
- {
- <% jsTRY %>
- document.location.replace( "<%= "pubpoint_ads.asp?server=" & g_strQueryStringServer & "&ppID=" & g_strPubPointID %>&op=togglepath&enableWrapper=on" );
- <% jsCATCH %>
- }
-
- ///////////////////////////////////////////////////////////////////////
- function ValidateInput()
- {
- <% jsTRY %>
- ValidatePath();
-
- if( document.mainForm.change.disabled )
- {
- event.cancelBubble=1;
- return false;
- }
- <% jsCATCH %>
- }
-
- var g_bIllegalPathAlerted = false;
-
- ///////////////////////////////////////////////////////////////////////
- function ValidatePath()
- {
- <% jsTRY %>
- var szPath = new String( document.forms.mainForm.path.value );
-
- // perform left trim
- szPath = szPath.replace( /^\s+/, "" );
-
- // perform right trim
- szPath = szPath.replace( /\s+$/, "" );
-
- var szIllegalChars = /;|\^|\'|\<|\>|\`|\f|\n|\r/gi;
- if( -1 != szPath.search( szIllegalChars ) )
- {
- document.forms.mainForm.change.disabled = true;
- document.forms.mainForm.path.style.color="#ff0000";
- window.status = "<%= L_INVALIDCHARSINPATH_TEXT %>";
- if( ! g_bIllegalPathAlerted )
- {
- g_bIllegalPathAlerted = true;
- window.alert( "<%= L_INVALIDCHARSINPATH_TEXT %>" );
- }
- return;
- }
-
- <% if( bReloadedForPathError )then %>
- if( szPath != "<%= UnescapeFilePathSlashes( TrimFileColon( strNewPath ) ) %>" )
- <% else %>
- if( szPath != "<%= UnescapeFilePathSlashes( TrimFileColon( strCurrentWrapperPath ) ) %>" )
- <% end if %>
- {
- document.forms.mainForm.change.disabled = false;
- document.forms.mainForm.path.style.color="#000000";
- }
- else
- {
- document.forms.mainForm.change.disabled = true;
- <% if( bReloadedForPathError )then %>
- document.forms.mainForm.path.style.color="#ff0000";
- <% end if %>
- }
- <% jsCATCH %>
- }
- -->
- </script>
- </head>
- <body bgcolor="white" topmargin="0" leftmargin="0" rightmargin="0" marginwidth="0" marginheight="0" onLoad="JavaScript:ValidatePath();" oncontextmenu="JavaScript:event.cancelBubble=true;return false;">
- <%
- ' Draw the page banner and tabs
- DrawPPNameBanner L_ADSTABTITLE_TEXT
- %>
- <br>
- <form name="mainForm" method="post" action="<%= RemoveDangerousCharacters( g_strQueryString ) %>" onsubmit="JavaScript:return( ValidateInput() );" AUTOCOMPLETE="OFF">
- <input type="hidden" name="server" value="<%= RemoveSpecifiedChars( g_strQueryStringServer, "\f|\n|\r|<|>" ) %>">
- <input type="hidden" name="ppID" value="<%= RemoveSpecifiedChars( g_strPubPointID, "\f|\n|\r|<|>" ) %>">
- <input type="hidden" name="op" value="ChangeWrapper">
- <table cellpadding="2" cellspacing="2" class="tabwhitearea" STYLE="BORDER-COLLAPSE: collapse">
- <tr>
- <td colspan="2"><p class="helptext"><%= Server.HTMLEncode( L_PPADSLEARN_TEXT ) %></p></td>
- </tr>
- <tr>
- <td colspan="2"><b><a tabIndex=<%= dwTabIndex %> <% dwTabIndex = dwTabIndex + 1 %> oncontextmenu="JavaScript:event.cancelBubble=true;return false;" href="JavaScript:DoHelp( '/', '<%= Server.HTMLEncode( H_USINGPPADSTOPIC ) %>' );"><%= Server.HTMLEncode( L_PPADSLEARNLINK_TEXT ) %></a></b><br> </td>
- <tr>
- <td colspan="2"><p class="helptext"><%= Server.HTMLEncode( L_ADDPPADS_TEXT ) %></p></td>
- </tr>
- <tr><!-- Nested Table 4 - Group Box -->
- <td align="left" width="20">
-
- </td>
- <td align="left" class="tabwhitearea" STYLE="BORDER-COLLAPSE: collapse">
- <table class="groupbox" width="90%" cellspacing="2" cellpadding="2" border="0" cols="3">
- <tr>
- <td colspan="3" class="subheader"><IMG height="32" src="img/inter_advert_32.gif" width="32" align="left" border="0"><%= Server.HTMLEncode( L_INTERADS_TEXT ) %></td>
- </tr>
- <tr>
- <td colspan="3" class="helptext"><%= Server.HTMLEncode( L_PPADSHELP_TEXT ) %></td>
- </tr>
- <tr><td colspan="3"><hr size="1"></td></tr>
-
- <tr>
- <td colspan="3" class="subheader"><IMG height="32" src="img/wpleditor_updated_32.gif" width="32" align="left" border="0"><%= Server.HTMLEncode( L_ADSINWRP_TEXT ) %></td>
- </tr>
- <tr>
- <td colspan="3" class="helptext">
- <%= Server.HTMLEncode( L_WRAPPERHELP_TEXT ) %>
- </td>
- </tr>
- <tr>
- <td width="16">
- <input
- type="checkbox" <% if bWrapperPathEnabled then %>checked<% end if %>
- name="useWrapperCheckbox"
- value=""
- id="useWrapperCheckbox"
- onChange="JavaScript:<% if bWrapperPathEnabled then %>DisableWrapper();<% else %>EnableWrapper();<% end if %>"
- onClick="JavaScript:<% if bWrapperPathEnabled then %>DisableWrapper();<% else %>EnableWrapper();<% end if %>"
- tabIndex=<%= dwTabIndex %><% dwTabIndex = dwTabIndex + 1 %>>
- </td>
- <td colspan="2">
- <label for="useWrapperCheckbox" class="handcursor"><%= L_USEWRAPPER_TEXT %></label>
- </td>
- </tr>
- <tr>
- <td width="16">
- <img src="WMSspacer.gif" height="0" width="16" border="0">
- </td>
- <td class="helptext" nowrap><%= Server.HTMLEncode( L_ADSTABHELPSTRING_TEXT ) %></td>
- <td> </td>
- </tr>
- <tr>
- <td width="16">
- <img src="WMSspacer.gif" height="0" width="16" border="0">
- </td>
- <td nowrap>
- <input
- type="text"
- name="path"
- maxlength="<%= Server.HTMLEncode( MAX_PATH ) %>"
- value="<%
- if ( bReloadedForPathError or bError ) and ( 0 < Len( strNewPath ) ) then
- Response.Write( strNewPath )
- else
- Response.Write( TrimFileColon( strCurrentWrapperPath ) )
- end if %>"
- onKeyUp="JavaScript:ValidatePath();"
- onKeyDown="JavaScript:ValidatePath();"
- onChange="JavaScript:ValidatePath();"
- onPaste="JavaScript:ValidatePath();"
- size="<% if brMSIE = g_dwBrowserType then Response.Write( "80" ) else Response.Write( "40" ) end if %>"
- <% if bError and ( 0 < Len( strNewPath ) ) then %>style="color:red;"<% end if %>
- AUTOCOMPLETE="OFF"
- <% if FALSE = bWrapperPathEnabled then %> disabled <% else %> tabIndex=<%= dwTabIndex %><% dwTabIndex = dwTabIndex + 1 %><%end if %>
- >
- </td>
- <td>
- <input
- type="submit"
- value="<%= Server.HTMLEncode( L_APPLYBUTTON_TEXT ) %>"
- id="change"
- name="change"
- align="left"
- <% if bWrapperPathEnabled then %> tabIndex=<%= dwTabIndex %> <% dwTabIndex = dwTabIndex + 1 %> <% end if %>
- disabled>
- </td>
- </tr>
- </table><!-- End Nested Table 4 Group Box-->
- </td>
- </tr>
- </table>
- </form>
- <tr>
- <td>
- <table width=100% border="0">
- <tr>
- <td colspan=5> </td>
- </tr>
- <tr>
- <td>
- <p>
- <%
-
- dwLastToolbarIndex = 0
- if( Session( "ShowServerList" ) ) then
- ToolbarButtonText ( dwLastToolbarIndex ) = L_BUTTONRETURNTOSERVERLIST_TEXT
- ToolbarButtonImage( dwLastToolbarIndex ) = IMAGE_SERVERLIST
- ToolbarButtonLink ( dwLastToolbarIndex ) = SERVERSLIST_PATH
- ToolbarButtonAltText( dwLastToolbarIndex ) = L_RETURNTOSL_TEXT
- dwLastToolbarIndex = dwLastToolbarIndex + 1
- end if
- ToolbarButtonText ( dwLastToolbarIndex ) = L_BUTTONHELP_TEXT
- ToolbarButtonImage( dwLastToolbarIndex ) = IMAGE_HELP
- ToolbarButtonLink ( dwLastToolbarIndex ) = HELPTOKEN
- ToolbarButtonAltText( dwLastToolbarIndex ) = L_HELPALT_TEXT
- ToolbarHelpURL = H_PPADSHELPTOPIC
- ToolbarNesting = H_PPLEVEL
- %>
- <% DrawToolbar TRUE, ( dwLastToolbarIndex + 1 ) %>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td></tr></table>
- <%
- DrawRefreshControl TRUE
- DrawCopyrightInfo
- DrawStdFooter
- if( bError ) then
- AlertUserWithPopupErrorDialog
- %>
- <script language="JavaScript">
- document.location = "pubpoint_ads.asp?server=<%= g_strQueryStringServer & "&invalidPath=" %>" + SafeEscape( document.forms.mainForm.path.value ) + "<%= "&ppID=" & g_strPubPointID %>";
- </script>
- <%
- end if
- %>
- </body>
- </html>
- <%
- LatchCurrentPage "pubpoints/pubpoint_ads.asp", qs
- EndErrorHandling "pubpoint_ads.asp"
-
- on error resume next
- WMSServerHashASPCleanup
- WMSConnectASPCleanup
- %>